﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
using MSBTC.WinFormHelpers;
using MSBTC.CrystalReport;

namespace MSBTC.ReportViewer
{
    public partial class CostRptForm : Form
    {
        public CostRptForm()
        {
            InitializeComponent();
        }

        private void crysCost_Load(object sender, EventArgs e)
        {
            CostRpt crpt = new CostRpt();
            FormHelpers help = new FormHelpers();

            TextObject txtobj;
            txtobj = (TextObject)crpt.ReportDefinition.ReportObjects["txtIBud"];
            txtobj.Text = help.Budget();

            txtobj = (TextObject)crpt.ReportDefinition.ReportObjects["txtCost"];
            txtobj.Text = help.Cost();

            txtobj = (TextObject)crpt.ReportDefinition.ReportObjects["txtProfit"];
            txtobj.Text = help.Remain();

            txtobj = (TextObject)crpt.ReportDefinition.ReportObjects["txtproj"];
            txtobj.Text = help.Pname();


            crysCost.ReportSource = crpt;
            crysCost.RefreshReport();
        }
    }
}
